<?php
class Model_Bangcap extends Model{
public $table="bangcap"; 
public function insert_bangcap($data){
	$this->insert($this->table,$data);
	return TRUE;
}

public function listbangcap(){
	$this->order("id_bc DESC");
	$this->getdata($this->table);
	return $this->fetchall();
}

public function delete_bangcap($id){
	$this->where("id_bc = '$id'");
	$this->delete($this->table);
}

public function getbangcap($id){
	$this->where("id_bc = '$id'");
	$this->getdata($this->table);
	return $this->fetchone();
}

public function update_bangcap($data,$id){
		$this->where("id_bc = '$id'");
		$this->update($this->table,$data);
		return TRUE;
}

public function delete_all($str){
	$this->where("id_bc in ($str)");
	$this->delete($this->table);
}
public function listselect($str){
	$this->select("id_bc, ten_bc");
	$this->where("id_bc in ($str)");
	$this->getdata($this->table);
	return $this->fetchall();
}

}